Systems, methods and computer program products for automating retrieval of data from a db2 database

ABSTRACT

Data is automatically retrieved from a DataBase 2 (DB2) database using a DB2 scripter module that is configured to automatically log on to the DB2 database, to automatically perform a query of the DB2 database, and to automatically extract from the DB2 database a dataset that results from the query. A dataset processor module is configured to convert the dataset into a text file, and to deliver the text file to a delivery site, for retrieval by the user. The DB2 scripter module can extract the dataset by printing the dataset to a DB2 virtual printer and/or by exporting the dataset to a File Transfer Protocol (FTP) site.

FIELD OF THE INVENTION

This invention relates to data processing systems, methods and/orcomputer program products, and more specifically to DataBase 2 (DB2)database systems, methods and/or computer program products.

BACKGROUND OF THE INVENTION

Databases are widely used on computers to store and retrieveinformation. Enterprise database environments may be provided onenterprise data processing systems, to store and retrieve data usinglarge enterprise databases, for use in transactional and/or real-timesystems. One widely used legacy, enterprise database environment isInternational Business Machines Corporation's (IBM) DataBase 2 (DB2)database environment.

Although DB2 databases are widely used with enterprise data, it may bedifficult for a typical user, who is not familiar with the DB2 databaseenvironment, to extract data needed by the user from the DB2environment.

SUMMARY OF THE INVENTION

Some embodiments of the present invention provide systems for automatingretrieval of data from a DB2 database. A DB2 scripter module isconfigured to automatically log on to the DB2 database, to automaticallyperform a query of the DB2 database and to automatically extract fromthe DB2 database a dataset that results from the query. A datasetprocessor module is configured to convert the dataset that is extractedfrom the DB2 database into a text file and to deliver the text file to adelivery site for retrieval by the user. In other embodiments, a userprocessor module is configured to convert the text file into a formatthat is viewable by the user. The DB2 scripter may be activated uponoccurrence of a predetermined event, such as a predetermined time and/orupon activation by a user, to automatically retrieve data from the DB2database.

In some embodiments, the DB2 scripter module automatically extracts thedataset that results from the query, by printing the dataset to a DB2virtual printer. In other embodiments, the DB2 scripter module exportsthe dataset to a File Transfer Protocol (FTP) site. In some embodiments,the dataset processor module comprises a UNIX scripter module and, insome embodiments, the user processor module comprises a personalcomputer spreadsheet macro.

It will be understood that, although embodiments of the presentinvention have been described above primarily with respect to systemsfor automating retrieval of data from a DB2 database, other embodimentscan provide analogous methods and/or computer program products. Othersystems, methods, and/or computer program products according toembodiments will be or become apparent to one with skill in the art uponreview of the following drawings and detailed description. It isintended that all such additional systems, methods, and/or computerprogram products be included within this description, be within thescope of the present invention, and be protected by the accompanyingclaims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1-3 are block diagrams of systems, methods and/or computer programproducts for automating retrieval of data from a DB2 database accordingto various embodiments of the present invention.

FIG. 4 is a flowchart of operations that may be performed according tovarious embodiments of the present invention, to automatically retrievedata from a DB2 database.

FIGS. 5-12 illustrate various user interfaces that may be activated whenautomatically retrieving data from a DB2 database according to variousembodiments of the present invention.

FIG. 13 is a flowchart of operations that may be performed toautomatically retrieve data from a DB2 database according to otherembodiments of the present invention.

FIG. 14 is a block diagram of a DB2 scripter module that may be providedaccording to various embodiments of the present invention.

FIG. 15 is a flowchart of operations that may be performed by a UNIXscripter module according to various embodiments of the presentinvention.

DETAILED DESCRIPTION

The present invention now will be described more fully hereinafter withreference to the accompanying figures, in which embodiments of theinvention are shown. This invention may, however, be embodied in manyalternate forms and should not be construed as limited to theembodiments set forth herein.

Accordingly, while the invention is susceptible to various modificationsand alternative forms, specific embodiments thereof are shown by way ofexample in the drawings and will herein be described in detail. Itshould be understood, however, that there is no intent to limit theinvention to the particular forms disclosed, but on the contrary, theinvention is to cover all modifications, equivalents, and alternativesfalling within the spirit and scope of the invention as defined by theclaims. Like numbers refer to like elements throughout the descriptionof the figures.

The present invention is described below with reference to blockdiagrams and/or flowchart illustrations of methods, apparatus (systems)and/or computer program products according to embodiments of theinvention. It is understood that a block of the block diagrams and/orflowchart illustrations, and combinations of blocks in the blockdiagrams and/or flowchart illustrations, can be implemented by computerprogram instructions. These computer program instructions may beprovided to a processor of a general purpose computer, special purposecomputer, and/or other programmable data processing apparatus to producea machine, such that the instructions, which execute via the processorof the computer and/or other programmable data processing apparatus,create means for implementing the functions/acts specified in the blockdiagrams and/or flowchart block or blocks.

These computer program instructions may also be stored in acomputer-readable memory that can direct a computer or otherprogrammable data processing apparatus to function in a particularmanner, such that the instructions stored in the computer-readablememory produce an article of manufacture including instructions whichimplement the function/act specified in the block diagrams and/orflowchart block or blocks.

The computer program instructions may also be loaded onto a computer orother programmable data processing apparatus to cause a series ofoperational steps to be performed on the computer or other programmableapparatus to produce a computer-implemented process such that theinstructions which execute on the computer or other programmableapparatus provide steps for implementing the functions/acts specified inthe block diagrams and/or flowchart block or blocks.

As will be appreciated by one of skill in the art, the present inventionmay be embodied as a method, data processing system and/or computerprogram product. Thus, the present invention may take the form of anentirely hardware embodiment, an entirely software embodiment or anembodiment combining software and hardware aspects, which may becollectively referred to herein as a “module”.

It should also be noted that in some alternate implementations, thefunctions/acts noted in the blocks may occur out of the order noted inthe flowcharts. For example, two blocks shown in succession may in factbe executed substantially concurrently or the blocks may sometimes beexecuted in the reverse order, depending upon the functionality/actsinvolved.

FIG. 1 is a block diagram of systems, methods and/or computer programproducts for automating retrieval of data from a DB2 database accordingto some embodiments of the present invention. As shown in FIG. 1, a DB2database 112 is contained on a DB2 host 110. DB2 host 110 may includeone or more enterprise, application, personal, pervasive and/or embeddedcomputer systems that may be interconnected by one or more networks,including the Internet. Moreover, the DB2 database 112 may be acentralized or distributed DB2 database. The design and operation of theDB2 host 110 and the DB2 database 112 are well known to those havingskill in the art and need not be described further herein.

Still referring to FIG. 1, a server 120, such as a UNIX server, may becontained on one or more enterprise, application, personal, pervasiveand/or embedded computing systems that may be interconnected by one ormore networks, including the Internet. Moreover, the server 120 may beintegrated, at least in part, with the DB2 host 110.

As shown in FIG. 1, the server 120 includes a DB2 scripter module 122that may include general purpose hardware, dedicated hardware and/or oneor more computer programs that are configured to automatically log on tothe DB2 database 112, to automatically perform a query of the DB2database 112, and to automatically extract from the DB2 database adataset 140 that results from the query. In FIG. 1, the dataset 140 isshown as being exported outside the DB2 host 110, and residing outsidethe server 120. However, it will be understood that the dataset 140 maybe contained at least partially in the DB2 host 110 and/or in the server120.

Still referring to FIG. 1, a dataset processor module 124, which mayinclude general purpose hardware, dedicated hardware and/or one or morecomputer programs, is configured to convert the dataset 140 that isextracted from the DB2 database 112 into a text file 150, and to deliverthe text file to a user processor 130, for retrieval by at least oneuser 132. It will be understood by those having skill in the art thatthe dataset processor module 124 may be at least partially integratedwith the DB2 scripter module 122, and may be included on the same and/ora different data processing system therefrom. Moreover, although thetext file 150 is shown as being external to the DB2 host 110 and server120, it may be at least partially contained therein. The user processor130 may include one or more enterprise, application, personal, pervasiveand/or embedded computing systems that may be interconnected by one ormore networks, including the Internet. Finally, although the userprocessor 130 is shown as being separate from the server 120 and/or theDB2 host 110, it also may be at least partially included therein.

FIG. 2 is a block diagram of other embodiments of the present invention.As shown in FIG. 2, in these embodiments, the DB2 scripter module 122 isconfigured to automatically extract from the DB2 database 112 a datasetthat results from the query by printing the dataset to a DB2 virtualprinter 240. Moreover, the dataset processor mode 124 may be embodied bya UNIX scripter module 224 that may include general purpose hardware,dedicated hardware and/or one or more computer programs. As also shownin FIG. 2, the user processor 130 may be embodied as a personal computer230 that executes a conventional database or spreadsheet product such asa Microsoft Excel spreadsheet 232.

FIG. 3 is a block diagram of still other embodiments of the presentinvention. In these embodiments, the DB2 scripter module 122 isconfigured to automatically extract from the DB2 database 112 a datasetthat results from the query by exporting the dataset to a File TransferProtocol (FTP) site 340. As is well known to those having skill in theart, FTP is a protocol that is used to upload and download files on theInternet. An FTP site on the Internet can store a number of files, andruns an FTP server application that waits for transfer requests. Thedesign of FTP sites are well known to those having skill in the art andneed not be described further herein.

FIG. 4 is a flowchart of operations that may be performed according tovarious embodiments of the present invention, to automatically retrievedata from a DB2 database. These operations may be performedautomatically in response to occurrence of a predetermined event atBlock 410, such as occurrence of a predetermined time and/or activationby a user. As used herein, the term “automatically” means that manualintervention is not needed in order to retrieve the data from the DB2database upon occurrence of the predetermined event. Operations of FIG.4 may be performed by the DB2 scripter module 122 and/or the datasetprocessor module 124 of FIG. 1 and/or the DB2 scripter module 122 and/orthe UNIX scripter module 224 of FIGS. 2 and/or 3.

More specifically, in some embodiments, the predetermined event at Block410 is occurrence of a predetermined time, such that the operations ofFIG. 4 are performed upon occurrence of a predetermined time. The resultof the operations may then be available to various users, such as an enduser 132 of FIGS. 1-3 when desired by an end user. In other embodiments,the predetermined event at Block 410 may be activation by anadministrative user who is different from the user 132 of FIGS. 1-3. Forexample, a programmer, server administrator or other individual withlinks to the server 120 of FIGS. 1-3 can initiate the operations of FIG.4 as an administrative user. Thus, in embodiments wherein thepredetermined event is an occurrence of a predetermined time oractivation by an administrative user, a single query of the database maybe performed once in order to allow several end users, such as the endusers 132 of FIGS. 1-3, to use the same data from the DB2 host 110.These embodiments can thereby reduce or eliminate the occurrence ofseveral end users initiating repetitive queries for the same data fromthe DB2 host, as well as reducing excessive demands on the server 120and/or DB2 host 110. In other embodiments, the predetermined event canbe activation by an end user, such as an end user 132 of FIGS. 1-3. Thismay allow the very latest data to be obtained by the end user 132 at thepotential expense of performing repetitive queries for the same dataand/or placing additional demands on the server 120 and/or DB2 host.

Still referring to FIG. 4, upon occurrence of the predetermined event atBlock 410, a DB2 scripter module, such as the DB2 scripter module ofFIGS. 1-3, may be activated, for example under control of the datasetprocessor module 124 of FIG. 1 and/or UNIX scripter module 224 of FIG. 2or 3. The DB2 scripter module 122 is configured to automatically log onto the DB2 database at Block 420, to automatically perform a query ofthe DB2 database at Block 430, and to automatically extract from the DB2database a dataset, such as dataset 140, which results from the query,at Block 440. Operations of Blocks 420, 430 and 440 will now bedescribed in detail below.

In particular, referring again to Block 420, the DB2 scripter 122 may beconfigured to automatically log on to the DB2 database, such as the DB2database 112. As is well known to those having skill in the art, loggingon to a DB2 database may be a complicated task. For example, as shown inFIG. 5, logging into a DB2 database 112 generally begins by connecting a3270 session, and logging on to the application, for example byinputting “@XXX”. The log-in may then continue as shown in FIG. 6, byproviding a user ID and password, and then waiting at FIG. 7, untilthree asterisks “***” are returned by the DB2 database 112. After theasterisks are provided as shown in FIG. 7, the ENTER key is then pressedand three more asterisks eventually appear. ENTER may be pressed againand yet three more asterisks may appear, to thereby provide a first DB2screen as shown in FIG. 8. According to embodiments of the presentinvention, the operations of FIGS. 5-8 are automatically performed bythe DB2 scripter module 122 at Block 420, to automatically log on to theDB2 database 112.

Returning again to FIG. 4, a query then may automatically be performedat Block 430, for example, by automatically entering “i.l.a.db2;4” onthe screen of FIG. 8, to obtain the Query Management Facility (QMF)screen of FIG. 9. A command to display or run a query, such as “ditmeast” or “run tmeast”, is then entered, as also shown in FIG. 9. Ifthe query of FIG. 9 is run successfully, the display of FIG. 10 mayappear.

Referring again to FIG. 4, at Block 440, the DB2 scripter module 122 isalso configured to automatically extract from the DB2 database 112 adataset that results from the query. As shown in FIG. 10, the DB2 modulescripter 122 is automatically configured to input a command to print thereport to a virtual printer, such as the virtual printer 240 of FIG. 2.Virtual printers are well known to users of DB2 environments, and neednot be described further herein. Optionally, at Block 450, the DB2scripter 122 may be configured to log off the DB2 database 112, afterthe query results are extracted. In other embodiments, the DB2 scriptermodule 122 may be automatically logged off the DB2 database 112 after apredetermined period of inactivity.

Returning again to FIG. 4, at Block 460, the dataset processor module124 and/or UNIX scripter module 224 may be used to convert the dataset140 to a text file 150. For example, FIG. 11 illustrates an example of atext file that is generated from a dataset that results from running aDB2 query. The dataset 140 may be sent to a virtual printer 240. Fromthere, the UNIX scripter module 240 can pick up the dataset 140 andconvert it to a text file 150, as shown in FIG. 11. Finally, referringagain to FIG. 4, at Block 470, the text file 150 is provided to a userprocessor, such as the user processor 130 of FIG. 1, or the personalcomputer 230 of FIG. 2 or 3. The text file 150 may then be imported intoa Microsoft Excel file using macros that are provided with MicrosoftExcel and/or using other techniques.

FIG. 12 is an example of a user interface that may be provided to an enduser 132 of embodiments of the present invention. The user interface maybe provided by the user processor 130 and/or PC 230 of FIGS. 1-3. Thisuser interface allows a user to access data from a DB2 program that isreferred to as AFIG Relog. As shown in FIG. 12, an end user may simplyselect the “Get New Data” button at any time, which causes the userprocessor 130 and/or PC 230 of FIGS. 1-3 to import the text file 150 andprocess the text file 150 to format the text file into a desired formatfor the end user 132. Thus, in some embodiments, the “Get New Data”button does not activate the DB2 scripter 122 and/or UNIX scripter 120but, rather, may only retrieve the results of a query of the DB2database 112 that was last made upon occurrence of a predeterminedevent. However, in other embodiments, the activation of the “Get NewData” button can provide the predetermined event 410 of FIG. 4, afterwhich operations of Blocks 420-470 are automatically performed. Ineither case, from an end user perspective, all the end user need do isactivate the button 1212 to obtain new data from the text file 150.Button 1214 allows the end user to view the text field data retrieved bybutton 1212 as specific states and/or types.

Thus, the end user who utilizes the Excel “Get New Data” button canretrieve the most recent “churn” produced by the dataset processor 124and/or UNIX scripter 224 at the server 120, from the text file deliverysite 150. The “Get New Data” button in Excel may not have any links tothe dataset processor 124 and/or UNIX scripter 224 which may allow it toinitiate the DB2 query. A programmer, server administration type orother user (administrative user), who need not be the end user, can beprovided with links to the server 120, to initiate the operations ofFIG. 4 as an administrative user, but not an end user who is an Excelmacro delivery site recipient. This can be beneficial, in that the DB2database may be queried once to allow several end users to use the samedata as recipients from the delivery site. This can reduce or eliminateseveral recipients performing repetitive queries for the same data, aswell as reducing excessive demands on the server and/or DB2 processor.

FIG. 13 is a flowchart of operations that may be performed toautomatically retrieve data from a DB2 database according to otherembodiments of the present invention. As shown at Block 1310, a DB2scripter module 122 may be created using a “Taskmate” program. As iswell known to those having skill in the art, Taskmate is a softwaredevelopment environment that supports end user programming and allowsusers to customize host applications and mechanize host interactionsthrough a high level workflow language. Taskmate is described, forexample, in the Taskmate Reference Manual, Version 7.0, Wotech SoftwareSystems, 1996-1997, and in U.S. Pat. No. 5,920,846. However, it will beunderstood that other DB2 scripter modules 122 may be used or designedaccording to embodiments of the present invention, to emulate manualkeystrokes for DB2. In some embodiments, the Taskmate program mayexecute upon a predetermined event (Block 410), such as every 30minutes, and/or upon a user request.

Referring now to Block 1320, the virtual printer 240 and/or FTP site 340receives the resulting dataset. At Block 1330, UNIX scripts, such asprovided UNIX scripter module 224, take the dataset from the virtualprinter 240 and/or FTP site 340, and convert it into a text file 150. Insome embodiments, if the dataset is contained in a virtual printer file240, the conversion can take place by renaming the file as a .txt file.Then, at Block 1340, the UNIX scripts, such as provided by the UNIXscripter module 224, sends the text file to a delivery site forretrieval by a user. It will be understood that the delivery site may bean unpublished Web directory, a shared folder on a PC and/or any otheruser accessible site.

FIG. 14 is a block diagram of a DB2 scripter module, which maycorrespond to DB2 scripter module 122 of FIGS. 1-3, according to someembodiments of the present invention, and which may perform theoperations of Block 1310. As shown in FIG. 14, in some embodiments, aDB2 scripter module 1400 can include a procedure 1420 that declares andinitializes variables, a procedure 1430 to perform the DB2 log-on, aprocedure 1440 to find various strings that are returned by DB2, aprocedure 1450 to decrypt DB2 passwords, a procedure 1460 to allow theDB2 scripter module to wait for a response from DB2, and an errorprocessing procedure 1470. A main procedure 1410 can interact with allof the procedures 1420-1470, to log on to DB2, run the query, export theresults to a virtual printer or FTP site, and log out of DB2.

FIG. 15 is a flowchart of operations that may be performed by a UNIXscripter module, such as the UNIX scripter module 224, operating inconjunction with a virtual printer 240, which may perform operations ofBlocks 1330 and 1340, according to various embodiments of the presentinvention. As shown in FIG. 15, at Block 1510, the virtual printer is“rejected” to thereby prevent additional files from being loaded intothe virtual printer. At Block 1520, the dataset is collected from thevirtual printer. At Block 1530, the virtual printer is reactivated toallow new files to be exported thereto. At Block 1540, the files arecopied to a destination, such as an unpublished website. Finally, atBlock 1550, the file permissions are changed to make the file read-only.

Accordingly, embodiments of the present invention can allow automaticretrieval of data from a DB2 database. Conventionally, data is extractedfrom DB2 using multiple manual steps to access and run a query, and thento export the data into Excel or another user program. For example, thefollowing steps conventionally may be performed manually:

-   -   1. Connect to a 3270 session.    -   2. Log into the application with e.g. @XXX.    -   3. Provide user id and password and wait for 3 asterisks.    -   4. Hit ENTER after 3 asterisks appear and wait for 3 more        asterisks.    -   5. Hit ENTER again when 3 more asterisks appear to reach first        screen.    -   6. Move through the next series of screens with e.g.        ‘I.L.A.DB2;4’.    -   7. Finally reach the query screen then enter ‘DI or RUN query’        to display or run.    -   8. When result set appears type ‘export report to xxxxxxxx’.    -   9. Log out of system using 5 separate commands.    -   10. FTP file to user's hard drive.    -   11. Open an Excel workbook and activate the import wizard.    -   12. Move through the conventional five steps of the wizard to        view the data.    -   13. Save file as is or utilize a variety of other sorts and        filters in Excel.        In contrast, embodiments of the present invention can        automatically retrieve data from a DB2 database upon occurrence        of a predetermined event.

In the drawings and specification, there have been disclosed embodimentsof the invention and, although specific terms are employed, they areused in a generic and descriptive sense only and not for purposes oflimitation, the scope of the invention being set forth in the followingclaims.

1. A system for automating retrieval of data from a DataBase 2 (DB2)database comprising: a memory and a processor; a DB2 scripter modulethat is configured to automatically log on to the DB2 database, toautomatically perform a query of the DB2 database and to automaticallyextract from the DB2 database a dataset that results from the query; anda dataset processor module that is configured to convert the datasetthat is extracted from the DB2 database into a text file and to deliverthe text file to a delivery site for retrieval by a user. 2-3.(canceled)
 4. A system according to claim 1 wherein the DB2 scriptermodule is activated upon occurrence of a predetermined event.
 5. Asystem according to claim 4 wherein the predetermined event comprises apredetermined time and/or activation by a user.
 6. A system according toclaim 1 further comprising a user processor module that is configured toconvert the text file into a format that is viewable by the user.
 7. Asystem according to claim 1 wherein the dataset processor modulecomprises a UNIX scripter module.
 8. A system according to claim 6wherein the user processor module comprises a personal computerspreadsheet macro.
 9. A system according to claim 1 wherein the DB2scripter module is further configured to automatically log off the DB2database after automatically extracting the dataset that results fromthe query.
 10. A method for automatically retrieving data from a DB2database comprising the following that are automatically performed insequence in response to occurrence of a predetermined event: executing aDB2 script that is configured to log on to the DB2 database, to performa query of the DB2 database and to extract from the DB2 database adataset that results from the query; converting the dataset that isextracted from the DB2 database into a text file; and delivering thetext file to a delivery site for retrieval by a user. 11-12. (canceled)13. A method according to claim 10 wherein the predetermined eventcomprises a predetermined time and/or activation by a user.
 14. A methodaccording to claim 10 further comprising converting the text file into aformat that is viewable by the user.
 15. A method according to claim 14wherein the converting is performed by a personal computer spreadsheetmacro.
 16. A method according to claim 10 wherein the DB2 script isfurther configured to automatically log off the DB2 database afterautomatically extracting the dataset that results from the query.
 17. Acomputer program product that is configured to automate retrieval ofdata from a DataBase 2 (DB2) database, the computer program productcomprising a computer usable storage medium having computer-readableprogram code embodied in the medium, the computer-readable program codecomprising: computer-readable program code that is configured toautomatically log on to the DB2 database, to automatically perform aquery of the DB2 database and to automatically extract from the DB2database a dataset that results from the query; and computer-readableprogram code that is configured to convert the dataset that is extractedfrom the DB2 database into a text file and to deliver the text file to adelivery site for retrieval by a user. 18-19. (canceled)
 20. A computerprogram product according to claim 17 wherein the computer-readableprogram code that is configured to automatically log on to the DB2database is responsive to occurrence of a predetermined event.
 21. Acomputer program product according to claim 20 wherein the predeterminedevent comprises a predetermined time and/or activation by a user.
 22. Acomputer program product according to claim 20 further comprisingcomputer-readable program code that is configured to convert the textfile into a format that is viewable by the user.
 23. A computer programproduct according to claim 20 wherein the computer-readable program codethat is configured to automatically log on to the DB2 database isfurther configured to automatically log off the DB2 database afterautomatically extracting the dataset that results from the query.